package org.bjtu.hadooptest.hadoop;


import org.apache.hadoop.fs.FileStatus;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.data.hadoop.fs.FsShell;
import org.springframework.stereotype.Service;

@Service
public class HadoopFileCommand implements CommandLineRunner {

    @Autowired
    private FsShell shell;

    @Override
    public void run(String... args) throws Exception {
        for (FileStatus s : shell.lsr("/tmp")) {
            System.out.println("> " + s.getPath());
        }
    }

    public boolean isExist(String path, String file) {
        return false;
    }
}
